package com.soft.javase.day03.review.singleton;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/4/17
 */
public class SingletonDemo {
    /*private static SingletonDemo singletonDemo = new SingletonDemo();

    private SingletonDemo() {

    }

    public static SingletonDemo getInstance() {
        return singletonDemo;
    }*/

    private static SingletonDemo singletonDemo;

    private SingletonDemo() {

    }

    public static SingletonDemo getInstance() {
        if (singletonDemo == null) {
            singletonDemo = new SingletonDemo();
        }
        return singletonDemo;
    }
}
